cmake_minimum_required(VERSION 2.6)
project(hello)
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -D_DEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O0 -DNDEBUG")
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREAD OFF)
set(Boost_DEBUG TRUE)
find_package(Boost REQUIRED COMPONENTS date_time system)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
if (Boost_NOTFOUND)
	message(FATAL_ERROR "Boost not found")
endif()

if (WIN32)
	set(LIB ws2_32 wsock32)
	add_definitions(-D_WIN32_WINNT=0X0501)
endif()

set(SERVER_SRCS server/main.cpp)
set(CLIENT_SRCS client/main.cpp)
set(SERVER_BIN server)
set(CLIENT_BIN client)
add_executable(server ${SERVER_SRCS})
target_link_libraries(${SERVER_BIN} ${Boost_LIBRARIES} ${LIB})
add_executable(${CLIENT_BIN} ${CLIENT_SRCS})
target_link_libraries(${CLIENT_BIN} ${Boost_LIBRARIES} ${LIB})
